package com.saasovation.collaboration.port.adapter.spring;

import com.saasovation.collaboration.port.adapter.persistence.StorageCleaner;
import com.saasovation.collaboration.port.adapter.service.MockUserInRoleAdapter;
import com.saasovation.collaboration.port.adapter.service.UserInRoleAdapter;
import com.saasovation.common.event.sourcing.EventStore;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.core.JdbcTemplate;

@TestConfiguration
public class DomainTestConfiguration {

    @Bean
    public UserInRoleAdapter mockUserInRoleAdapter() {
        return new MockUserInRoleAdapter();
    }

    @Bean
    public StorageCleaner storageCleaner(JdbcTemplate jdbcTemplate,
                                         EventStore eventStore) {
        return new StorageCleaner(jdbcTemplate, eventStore);
    }
}
